import smtplib
server = smtplib.SMTP('smtp.live.com', 25)
server.ehlo()
server.starttls()
server.ehlo()
server.login('test@live.com', '123456')
msg = 'To: test@163.com\r\nFrom: test@live.com\r\nSubject: test \r\n\r\n test mail\r\n'
server.sendmail('test@live.com','test@163.com', msg)
server.close()
